Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

HouseHold calculated in the API #70

Merged
merged 4 commits into from
Aug 28, 2024
Merged

HouseHold calculated in the API #70

merged 4 commits into from
Aug 28, 2024

Conversation

gabrielegranello
Copy link
Collaborator

What does this PR do?

It allows for the Farihold calculation to happen in the API. See #69

Before this PR

The API route.ts used to fetch the data and pass it to the frontend. Then, the Fairhold calculations used to happen in the frontend.

Now

The API route.ts also computes the Fairhold calculations, and it returns the results to the frontend.

Side issue/fix

I think that there was mismatch in how we were dealing with socialRentAdjustements. Specifically:

  1. Data such as inflation are type of number in the database
  2. socialRentAdjustmentsRepo.ts was converting the data into string || null
  3. Later, this data was treated as numbers to perform the calculations

Within socialRentAdjustmentsRepo.ts I deleted the conversion to string and set up a clause guard to check for null.

Not sure if that's the best approach

Copy link

vercel bot commented Aug 26, 2024

The latest updates on your projects. Learn more about Vercel for Git ↗︎

Name Status Preview Comments Updated (UTC)
fairhold-dashboard ✅ Ready (Inspect) Visit Preview 💬 Add feedback Aug 26, 2024 9:28am

@gabrielegranello gabrielegranello marked this pull request as ready for review August 26, 2024 09:32
@gabrielegranello gabrielegranello requested a review from a team August 26, 2024 09:32
Copy link
Collaborator

@zz-hh-aa zz-hh-aa left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Looks good to me, nice work!

@gabrielegranello gabrielegranello merged commit 4d9acc2 into main Aug 28, 2024
3 checks passed
@gabrielegranello gabrielegranello deleted the gg/household-api branch August 28, 2024 08:13
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants